package com.example.result.kotlin.base

import org.junit.Test
import java.lang.StringBuilder
import java.util.*

class StringTest {
    @Test
    fun test_slice(){
        var a="hello world!!"
        assert(a.slice(0..5)==a.substring(0..5))
        val i1 = (Int.MAX_VALUE + 3) shr 2
        assert(i1 <0)
        val i = (Int.MAX_VALUE + 3) ushr 2
        assert(i >0)
        println("$i1 $i")
        println(Int.MAX_VALUE*2 ushr 2)
        var builder=StringBuilder()
        builder.insert(0,"ab").repeat(2).let{
            println(it)
        }
        builder.deleteCharAt(0)
        builder.length
        2.toString()[0].let {
            println(it+"-")
        }

        assert(Integer.parseInt("10")==10)
        IntArray(3) {
            it-1
        }.copyInto(IntArray(3)).forEach {
            println("$it ")
        }
        "a".startsWith("",1)
    }
}